//
//  MinePageNoLoginCell.m
//  ShowYork
//
//  Created by hxh on 2020/8/26.
//  Copyright © 2020 hxh. All rights reserved.
//

#import "MinePageNoLoginCell.h"

@interface MinePageNoLoginCell ()
@property (nonatomic,strong)UIImageView *headerImgView;
@property (nonatomic,strong)UIButton *loginBtn;
@end

@implementation MinePageNoLoginCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    // Configure the view for the selected state
}


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self setUI];
    }
    return self;
}

- (void)setUI{
    self.headerImgView = [[UIImageView alloc]init];
    self.headerImgView.layer.cornerRadius = KScaleWidth(35);
    self.headerImgView.layer.masksToBounds = YES;
    [self.contentView addSubview:self.headerImgView];
      
    [self.headerImgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(CGSizeMake(KScaleWidth(70), KScaleWidth(70))).priorityHigh();
        make.top.equalTo(self.contentView).offset(20);
        make.bottom.equalTo(self.contentView).offset(-20);
        make.left.equalTo(self.contentView).offset(15);
    }];

    self.loginBtn = [[UIButton alloc]init];
    [self.loginBtn setTitle:@"登录/注册" forState:UIControlStateNormal];
    [self.loginBtn setTitleColor:RGBA(35, 24, 21,1) forState:UIControlStateNormal];
    self.loginBtn.titleLabel.font = font(18);
    [self.loginBtn addTarget:self action:@selector(loginMethod) forControlEvents:UIControlEventTouchUpInside];
    [self.contentView addSubview:self.loginBtn];
    
    [self.loginBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.headerImgView);
        make.left.equalTo(self.headerImgView.mas_right).offset(15);
        make.width.mas_equalTo(120);
    }];
}

- (void)loginMethod{
    
}

+(instancetype)cellWithTableView:(UITableView *)tableView{
    NSString *ID = @"MinePageNoLoginCell";
    MinePageNoLoginCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (!cell) {
        cell = [[MinePageNoLoginCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    }
    return cell;
}

@end
